using Asp.Versioning;
using Asp.Versioning.OData;
using Microsoft.OData.ModelBuilder;
using OData.Shared.Models;

namespace OData.WebApi.Configuration;

public class OrderModelConfiguration : IModelConfiguration
{
	public void Apply(ODataModelBuilder builder, ApiVersion apiVersion, string? routePrefix)
	{
		var order = builder.EntitySet<Order>("Orders").EntityType;
		order.HasKey(o => o.Id);
		order.ContainsMany(o => o.LineItems);
		//Todo: Add Function configuration and Action configuration
	}
}
